package org.opens.jquery;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 功能:
 *
 * @author zym
 * @Date 2021/6/29 14:34
 */
@Controller(value = "/jquery")
@RequestMapping(value = "/jquery")
public class JqueryTest {

    @RequestMapping(value = "/page/ajax-test")
    public String goAjaxTest() {
        return "jquery/ajaxTest";
    }

    @RequestMapping(value = "/text")
    public void returnTextTest(HttpServletRequest request, HttpServletResponse response) throws IOException {
        PrintWriter writer = response.getWriter();
        writer.write("ok");
        writer.flush();
        writer.close();
    }

}
